import request from '@/utils/request'
// 获取订单交易页信息
export const reqTradeList = () => {
  return request({
    method: 'GET',
    url: '/order/auth/trade',
  })
}
//提交订单
export const reqSubmitOrder = ({
  tradeNo,
  consignee,
  consigneeTel,
  deliveryAddress,
  paymentWay,
  orderComment,
  orderDetailList,
}) => {
  return request({
    method: 'POST',
    url: '/order/auth/submitOrder',
    params: {
      tradeNo,
    },
    data: {
      consignee,
      consigneeTel,
      deliveryAddress,
      paymentWay,
      orderComment,
      orderDetailList,
    },
  })
}
//获取订单支付二维码
export const reqQRCode = (orderId) => {
  return request({
    method: 'GET',
    url: `/payment/weixin/createNative/${orderId}`,
  })
}
//查询支付订单状态
// /api/payment/weixin/queryPayStatus/{orderId}
export const reqPayStatus = (orderId) => {
  return request({
    method: 'GET',
    url: `/payment/weixin/queryPayStatus/${orderId}`,
  })
}

//获取我的订单列表
// /api/order/auth/{page}/{limit}
export const reqGetOrderList = (page, limit) => {
  return request({
    method: 'GET',
    url: `/order/auth/${page}/${limit}`,
  })
}
